package com.appistry.maven.plugin.far.remote.ssh;

import static org.junit.Assert.assertEquals;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.jcraft.jsch.JSchException;

public class SshExecIT {

	private SshExec sshExec;

	@Before
	public void setUp() throws Exception {
		SshConfig sshConfig = new SshConfig(SshConstants.HOST,
				SshConstants.PORT, new SshUserInfo(SshConstants.USER,
						SshConstants.PASSWORD, true));

		sshExec = new SshExec(sshConfig);
	}

	@After
	public void tearDown() throws Exception {
		sshExec = null;
	}

	@Test
	public void testExecuteCommand() throws JSchException {
		sshExec.executeCommand("ls -alrht");
		assertEquals(0, sshExec.getExitStatus());

		System.out.println(sshExec.getResult());
	}

}
